﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using VOL.Core.Utilities;
using VOL.Entity.AttributeManager;
using VOL.Entity.DomainModels.BasicData;
using VOL.SmartMecial.IServices.BasicData;

namespace VOL.WebApi.Controllers.SmartMecial
{

    //[Route("api/[controller]")]
    //[ApiController]

    /// <summary>
    /// 护理单元分配病房控制器
    /// </summary>
    [Route("api/NursingUnitWardController")]
    [PermissionTable(Name = "NursingUnitWardController")]
    public class NursingUnitWardController : ControllerBase
    {

        private readonly IAddNursingUnitService _addNursingUnitService;
        private readonly IBedNursingUnitService _bedNursingUnitService;
        private readonly INursingUnitShowService _nursingUnitShowService;

        public NursingUnitWardController(IAddNursingUnitService addNursingUnitService, IBedNursingUnitService bedNursingUnitService, INursingUnitShowService nursingUnitShowService)
        {
            _addNursingUnitService = addNursingUnitService;
            _bedNursingUnitService = bedNursingUnitService;
            _nursingUnitShowService = nursingUnitShowService;
        }
        /// <summary>
        ///添加护理单元病房
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost("AddNursingUnitWard")]
        public async Task<int> AddNursingUnitWard([FromBody] NursingUnitWardModel model)
        {
            return await _addNursingUnitService.AddNursingUnitWard(model);
        }

        /// <summary>
        /// 显示病房列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("BedNursingUnitShow")]
        public async Task<WebResponseContent> BedNursingUnitShow()
        {
            return await _bedNursingUnitService.BedNursingUnitShow();
        }

        /// <summary>
        ///  显示护理单元列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("NursingUnitShow")]
        public async Task<WebResponseContent> NursingUnitShow()
        {
            return await _nursingUnitShowService.NursingUnitShow();
        }
    }
}
